﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Enterprise.UI.Web.Modules.ZuanjingRb
{
    public partial class Zjrblr : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {                
                tb_rq.Text = (string)Enterprise.Infrastructure.Utility.sink("rq", Infrastructure.Utility.MethodType.Get, 0, 0, Infrastructure.Utility.DataType.Str);
                if (tb_rq.Text == "")
                {
                    tb_rq.Text = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd");
                }
                bindGrid();
            }
        }

        private void bindGrid()
        {
            Enterprise.Service.ZJRB.ZJRBService zservice = new Service.ZJRB.ZJRBService();
            string strWhere = "jh is not null";
            if (tb_jh.Text != "")
                strWhere += " and JH like '"+tb_jh.Text+"%'";
            if (tb_rq.Text != "")
                strWhere += " and ZJRQ ='"+tb_rq.Text+"'";
            gv.DataSource = zservice.GetList(strWhere);
            gv.DataBind();
        }

        protected void btn_Search_Click(object sender, EventArgs e)
        {
            bindGrid();
        }
    }
}